#ifndef CONFIGFILE_H
#define CONFIGFILE_H



#include <QVariant>
#include <QSettings>
#include <QDebug>
#include <QDir>
#include <QDate>
#include <QDateTime>
#include <QApplication>

typedef struct configInfo{
    int m_tomatoTime;
    int m_tomatoTime_rest;
    int m_tomatoAchieveToday;
    QString m_date;

    QString m_finishedTask;
    QString m_bellCurrent;
    int m_bellLoop;
    bool m_closeAndMinimize;
    bool m_autoRun;
    QString m_defaultDescribe;

    QString m_serverAddress;

    configInfo(int tomatoTime=45*60, int tomatoTime_rest=25*60, int tomatoAchieveToday=0, QString finishedTask="hidden", QString date="", QString bellCurrent=":/pics/alarm.wav", int bellLoop=3, bool closeAndMinimize=true,
               bool autoRun=false,QString defaultDescribe="", QString serverAddress="http://zzerweb.top:5657/");

}configInfo;

class configFile
{
public:
    configInfo m_config;
    enum {HIDDEN, DELETE};
public:
    configFile();
    void InitConfig();
    virtual ~configFile(void);

    QVariant Get(QString,QString);

    void save();
private:
    QString m_qstrFileName;
    QSettings *m_psetting;

    void Set(QString,QString,QVariant);
};




#endif // CONFIGFILE_H
